This invention relates to control mechanisms for enqueue and dequeue operations in a pipelined network processor.
A network processor should be able to store newly received packets to a memory structure at a rate at least as high as the arrival time of the packets. To avoid dropping packets and still maintain system throughput, a packet should be removed from memory and also transmitted at the packet arrival rate. Thus, in the time it takes for a packet to arrive, the processor must perform two operations: a store operation and a retrieve from memory operation. The ability to support a large number of queues in an efficient manner is essential for a network processor connected to a high line rate network.
System designs based on ring data structures use statically allocated memory addresses for packet buffering and may be limited in the number of queues that can be supported. Systems that use linked lists are more flexible and allow for a large number of queues. However, linked list queues typically involve locking access to a queue descriptor and queue pointers when a dequeue request is made while an enqueue operation is in progress. Similarly, access to a queue descriptor and queue pointers is typically locked when an enqueue request is made while a dequeue operation is in progress or when near simultaneous enqueue operations or near simultaneous dequeue operations are made to the same queues. Therefore, for network processors connected to high line rates when the network traffic is being directed at a small subset of the available queues, the latency to enqueue or dequeue packets from the same queue may be too great using atomic memory operators.